package com.shanling.shanlingcontroller.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.shanling.shanlingcontroller.base.BaseLazyFragment;
import com.shanling.shanlingcontroller.ui.fragment.GuideFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by ch1 on 2019/11/14.
 */

public class MusicPlayFragmentPagerAdapter extends FragmentPagerAdapter {

    private List<BaseLazyFragment> fragments=new ArrayList<>();
    public MusicPlayFragmentPagerAdapter(FragmentManager fm, List<BaseLazyFragment> fragments) {
        super(fm);
        this.fragments=fragments;
    }

    @Override
    public Fragment getItem(int i) {
        return fragments.get(i);
    }

    @Override
    public int getCount() {
        if(fragments!=null&&fragments.size()>0){
            return fragments.size();
        }
        return 0;
    }
}
